 <?php include './application/views/common/zhs_header.php';?>

<?php include './application/views/common/zhs_usercenter_acnt.php';?>
<div class="inv_box w">
<?php include './application/views/common/zhs_usercenter_left.php';?>
 <div class="membd_right">
  <h3 class="membdrg_tit">设置自动投标规则</h3>
  <form id="borrowautoForm" name="borrowautoForm">
	<input type="hidden" id="id" name="id" value="<?php echo $borrow_auto_obj['id'];?>">
	<input type="hidden" id="typer" name="typer" value="<?php echo $typer;?>">
    <div class="memzd_bd">
               <ul class="memzd_cont">
                  <li>
			             <dd>账户可用余额：</dd>
			            <dt>
			            	<?php echo($account['use_money']); ?>元
			            </dt> 
			          </li>
			          
			           <li>
			             <dd>是否启用：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="radio" id="fstatus" name="fstatus" value="1" <?php if($borrow_auto_obj['fstatus']=='1' && $typer=='update') echo "checked=\"checked\""; else echo "checked";?> ><em style="margin-right:14px; margin-top:2px; float:left;">是</em>
							<input type="radio" style="margin-right:6px; float:left;" id="fstatus" name="fstatus" value="0" <?php if($borrow_auto_obj['fstatus']=='0') echo "checked=\"checked\"";?>><em style="margin-right:6px; margin-top:2px; float:left;">否</em>
			            </dt> 
			          </li>
			          <li>
			             <dd>投标类型：</dd>
			            <dt>
			            	
			            	<?php foreach($borrow_type as $key=>$value){?>
							<input style="margin-right:6px; float:left;" type="radio" id="tender_type" name="tender_type" value="<?php echo $key;?>" <?php if($borrow_auto_obj['tender_type']==$key && $typer=='update') echo "checked=\"checked\""; else echo "checked";?>>
							<em style="margin-right:14px; margin-top:2px; float:left;"><?php echo $value;?></em>
							<?php }?>
			            </dt> 
			          </li>
			           <li>
			             <dd>单笔投标金额：</dd>
			            <dt>
						最小<input name="tender_account_min" class="pubinput"  type="text" maxlength="6" id="tender_account_min"  style="width:80px; height:22px; margin:0 8px;" value="<?php echo $borrow_auto_obj['tender_account_min'];?>"/>元(不能低于50元)
						最多<input name="tender_account_max" class="pubinput"  type="text" maxlength="10" id="tender_account_max"  style="width:80px; height:22 px; margin:0 8px;"  value="<?php echo $borrow_auto_obj['tender_account_max'];?>"/>元(不能高于10W元)
						
			            </dt> 
			          </li>
			           <li>
			             <dd>还款方式：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="checkbox" id="borrow_style_status" name="borrow_style_status" value="1" <?php if($borrow_auto_obj['borrow_style_status']=='1') echo "checked=\"checked\"";?>><em style="margin-right:14px; margin-top:2px; float:left;">是否启用
							<select id="borrow_style" name="borrow_style" class="pubinput">
							<?php foreach($borrow_style as $key=>$value){?>
							<option value="<?php echo $key;?>" <?php if($borrow_auto_obj['borrow_style']==$key) echo "selected";?>><?php echo $value; ?></option>
							<?php }?>
							</select></em>
			            </dt> 
			          </li>
			          <li>
			             <dd>保留金额：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="checkbox" id="retain_money_status" name="retain_money_status" value="1" <?php if($borrow_auto_obj['retain_money_status']=='1') echo "checked=\"checked\"";?>><em style="margin-right:14px; margin-top:2px; float:left;">是否启用
							<input name="retain_money" class="pubinput"  type="text" maxlength="8" id="retain_money"  style="width:80px; height:22px; margin:0 8px;"  value="<?php echo $borrow_auto_obj['retain_money'];?>"/>元</em>
			            </dt> 
			          </li>
			           <li>
			             <dd>标的期限：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="checkbox" id="timelimit_status" name="timelimit_status" value="1" <?php if($borrow_auto_obj['timelimit_status']=='1') echo "checked=\"checked\"";?>><em style="margin-right:14px; margin-top:2px; float:left;">是否启用
							<select id="timelimit_month_first" name="timelimit_month_first" class="pubinput">
								<?php foreach($borrow_time_limit as $key=>$value){?>
								<option value="<?php echo $key;?>" <?php if($borrow_auto_obj['timelimit_month_first']==$key) echo "selected";?>><?php echo $value;?></option>
								<?php }?>
							</select>-
							<select id="timelimit_month_last" name="timelimit_month_last" class="pubinput" >
								<?php foreach($borrow_time_limit as $key=>$value){?>
								<option value="<?php echo $key;?>"  <?php if($borrow_auto_obj['timelimit_month_last']==$key) echo "selected";?>><?php echo $value;?></option>
								<?php }?>
							</select></em>
			            </dt> 
			          </li>
			          <li>
			             <dd>利率选项：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="checkbox" id="apr_status" name="apr_status" value="1" <?php if($borrow_auto_obj['apr_status']=='1') echo "checked=\"checked\"";?>><em style="margin-right:14px; margin-top:2px; float:left;">是否启用
							<select id="apr_first" name="apr_first"  class="pubinput">
								<?php for($i = 6; $i < 31; $i=$i+2){?>
								<option value="<?php echo $i;?>"  <?php if($borrow_auto_obj['apr_first']==$i) echo "selected";?>><?php echo $i;?>%</option>
								<?php }?>
							</select>-
							<select id="apr_last" name="apr_last"  class="pubinput" >
								<?php for($i = 6; $i < 31; $i=$i+2){?>
								<option value="<?php echo $i;?>"  <?php if($borrow_auto_obj['apr_last']==$i) echo "selected";?>><?php echo $i;?>%</option>
								<?php }?>
							</select></em>
			            </dt> 
			          </li>
			          
			           <li>
			             <dd>奖励选项：</dd>
			            <dt>
			            	<input style="margin-right:6px; float:left;" type="checkbox" id="award_status" name="award_status" value="1" <?php if($borrow_auto_obj['award_status']=='1') echo "checked=\"checked\"";?>><em style="margin-right:14px; margin-top:2px; float:left;">是否启用
							<select id="award_first" name="award_first"  class="pubinput"  >
								<?php for($i = 1; $i < 16; $i=$i+2){?>
								<option value="<?php echo $i/10;?>" <?php if($borrow_auto_obj['award_first']==$i/10) echo "selected";?>><?php echo $i/10;?>%</option>
								<?php }?>
							</select>-
							<select id="award_last" name="award_last" class="pubinput"  >
								<?php for($i = 5; $i < 26; $i=$i+2){?>
								<option value="<?php echo $i/10;?>" <?php if($borrow_auto_obj['award_last']==$i/10) echo "selected";?>><?php echo $i/10;?>%</option>
								<?php }?>
								
							</select></em>
			            </dt> 
			          </li>
			          <!--<li>
			             <dd>信誉等级：</dd>
			            <dt>
			            	<input type="checkbox" id="credit_rating_status" name="credit_rating_status" value="1" <?php if($borrow_auto_obj['credit_rating_status']=='1') echo "checked=\"checked\"";?>>是否启用
							<select id="credit_rating_first" name="credit_rating_first"   class="pubinput" >
								<?php foreach($borrow_conset_credit as $key=>$value){?>
								<option value="<?php echo $key;?>"  <?php if($borrow_auto_obj['credit_rating_first']==$key) echo "selected";?>><?php echo $value;?></option>
								<?php }?>
							</select>-
							<select id="credit_rating_last" name="credit_rating_last"   class="pubinput" value="<?php echo $borrow_auto_obj['credit_rating_last'];?>">
								<?php foreach($borrow_conset_credit as $key=>$value){?>
								<option value="<?php echo $key;?>"  <?php if($borrow_auto_obj['credit_rating_last']==$key) echo "selected";?>><?php echo $value;?></option>
								<?php }?>
							</select>
			            </dt> 
			          </li>
			           --><li>
			             <dd>有效时间：</dd>
			            <dt>
							开始时间：<input type="text" id="strtime" name="valid_start_time" style="width: 100px;" value="<?php if($typer=='update')echo date('Y-m-d',$borrow_auto_obj['valid_start_time']); else echo $valid_start_time;?>"  onfocus="WdatePicker()" />--
			  				结束时间：<input type="text" id="endtime" name="valid_end_time" style="width: 100px;" value="<?php if($typer=='update')echo date('Y-m-d',$borrow_auto_obj['valid_end_time']); else echo $valid_end_time; ?>"  onfocus="WdatePicker()" />
			            </dt> 
			          </li>

                 <li><a href="javascript:;" style="margin-left:125px;" class="membtn"  onclick="borrowautoSubmit();" >保存设置</a></li>
                 <li><h4 class="memzdli_text">温馨提示:<br>
1、单笔最高投标额 是限制每次投标的实际投标额不得高于某个数值，一旦系统判断本次投标额高于该数值时，将自动按照投资最
大金额投s资。<br>
2、账户保留金额 是指每次投标后账户必须保留的最低可用余额。如果系统判断本次投标结束后账户可用余额将低于该数值，则本
次投标金额将修正为最大投标金额减去账户保留金额，且不能低于该借款标限制的最低投标额。该数值默认值为0。<br>
3、当前规则满足所有条件时，系统将为您自动投标的金额只能为大于0的整数。<br>
4、系统最终判定的实际投标金额如果超过借款标的最大投标额度则以该额度为准进行投标，如果小于标的最小投标额度则放弃此次
投标机会，排名继续前进。</h4></li>
              </ul>
     </div>
     </form>
</div>
<script type="text/javascript">
function borrowautoSubmit(){
	var options = {
		url : '/borrowauto/add/',
		//clearForm :true,
		//resetForm :true,
		//beforeSubmit:  checkForm,
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg==''){
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						location=ret.url;
					}
				}); 
				$("#msg").html("操作成功");
			}else{
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						//location=ret.url;
					}
				}); 
				$("#msg").html(ret.msg);
			}
		}
	};
	$("#borrowautoForm").ajaxSubmit(options);
	return false;
}
</script>
</div>
<?php include './application/views/common/zhs_footer.php';?>
<?php include './application/views/common/zhs_right.php';?>
</body>
</html>